/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.hycreate.platform.modules.crm.findcustomer;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hycreate.platform.common.persistence.Page;
import com.hycreate.platform.common.service.CrudService;

/**
 * 联系记录Service
 * @author 方志钧
 * @version 2016-12-07
 */
@Service
@Transactional(readOnly = true)
public class AllRecordsService extends CrudService<AllRecordsDao, AllRecords> {
	
	@Autowired
	private AllRecordsDao allRecordDao;

	public AllRecords get(String id) {
		return super.get(id);
	}
	
	public List<AllRecords> findList(AllRecords allRecords) {
		return super.findList(allRecords);
	}
	
	public Page<AllRecords> findPage(Page<AllRecords> page, AllRecords allRecords) {
		return super.findPage(page, allRecords);
	}
	
	@Transactional(readOnly = false)
	public void save(AllRecords allRecords) {
		super.save(allRecords);
	}
	
	@Transactional(readOnly = false)
	public void delete(AllRecords allRecords) {
		super.delete(allRecords);
	}
	
	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param entity
	 * @return
	 */
	public Page<AllRecords> findRecordPage(Page<AllRecords> page, AllRecords allRecords) {
		allRecords.setPage(page);
		page.setList(allRecordDao.findRecordList(allRecords));
		return page;
	}
	
}